<!--
 * @Author: wangjh wangjiahui0710@163.com
 * @Date: 2024-06-11 18:09:29
 * @LastEditors: wangjh wangjiahui0710@163.com
 * @LastEditTime: 2024-06-12 14:08:55
 * @FilePath: \cip-mobile\src\pages\login\index.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<!-- 创建单位页 -->
<script lang="ts" setup>
import { useUserStore } from '@/stores/user';
import { whManagerBsTbRiskHazardsSpecialgetById } from '@/genapi/wh';
import { ref } from 'vue';

defineOptions({ name: 'SpecialOperateReport' });
const userStore = useUserStore();

const router = useRouter();
let form = ref('')
const unitColumns1 = ref([
	{ text: '动火作业', value: '1' },
	{ text: '受限空间作业', value: '2' },
	{ text: '盲板抽堵作业', value: '3' },
	{ text: '高处作业', value: '4' },
	{ text: '吊装作业', value: '5' },
	{ text: '临时用电作业', value: '6' },
	{ text: '动图作业', value: '7' },
	{ text: '断路作业', value: '8' },
]);

const unitColumns2 = ref([
	{ text: '待施工', value: '1' },
	{ text: '施工中', value: '2' },
	{ text: '已验收', value: '3' },
]);
onMounted(async() => {
  whManagerBsTbRiskHazardsSpecialgetById(userStore.specialOperateId).then(res => {
    form.value = res.data
  })
})
const type = computed(() => {
	const res = unitColumns1.value.find((item) => {
		return item.value === form.value.taskType;
	});
	return res?.text;
});

const status = computed(() => {
	const res = unitColumns2.value.find((item) => {
		return item.value === form.value.taskStatus;
	});
	return res?.text;
});



const back = () => {
	router.replace({ path: '/home' });
};
function logOut() {
	userStore.logout();
}
</script>

<template>
	<div class="create-unit-page">
		<nut-navbar title="特殊作业详情" left-show @click-back="back"></nut-navbar>
		<nut-form ref="formRef" :model-value="form">
			<nut-form-item>
				<div class="basedata-form-title">基本信息</div>
			</nut-form-item>
			<nut-form-item prop="dwmc" label="作业名称">
				<nut-input v-model="form.taskName" placeholder="请输入" type="text" readonly> </nut-input>
			</nut-form-item>
			<nut-form-item prop="fzpq" label="作业单位">
				<nut-input v-model="form.taskUnit" placeholder="请输入" type="text" readonly> </nut-input>
			</nut-form-item>
      <nut-form-item prop="fzpq" label="作业类型">
				<nut-input v-model="type" placeholder="请输入" type="text" readonly> </nut-input>
			</nut-form-item>
      <nut-form-item prop="fzpq" label="作业状态">
				<nut-input v-model="status" placeholder="请输入" type="text" readonly> </nut-input>
			</nut-form-item>
      <nut-form-item prop="fzpq" label="作业位置">
				<nut-input placeholder="整不了" type="text" readonly> </nut-input>
         <div></div>
			</nut-form-item>
      <nut-form-item prop="fzpq" label="上报时间">
				<nut-input v-model="form.reportTime" placeholder="请输入" type="text" readonly> </nut-input>
			</nut-form-item>
      <nut-form-item prop="fzpq" label="实施时间">
				<nut-input v-model="form.handleTime" placeholder="请输入" type="text" readonly> </nut-input>
			</nut-form-item>
      <nut-form-item prop="fzpq" label="作业负责人">
				<nut-input v-model="form.taskMaster" placeholder="请输入" type="text" readonly> </nut-input>
			</nut-form-item>
      <nut-form-item prop="fzpq" label="验收人">
				<nut-input v-model="form.acceptance" placeholder="请输入" type="text" readonly> </nut-input>
			</nut-form-item>
      <nut-form-item prop="fzpq" label="现场作业人员">
				<nut-input v-model="form.sceneMaster" placeholder="请输入" type="text" readonly> </nut-input>
			</nut-form-item>
      <nut-form-item prop="fzpq" label="安全措施">
				<nut-input v-model="form.handleDesc" placeholder="请输入" type="text" readonly> </nut-input>
			</nut-form-item>

			<!-- <nut-form-item>
				<nut-button block class="create-unit-submit-button" @click="logOut"> 退出登录 </nut-button>
			</nut-form-item> -->
		</nut-form>
	</div>
</template>

<style scoped lang="scss">
.create-unit-page {
	display: flex;
	flex-direction: column;
	width: 100vw;
	--nut-cell-color: #000;
	--nut-cell-box-shadow: 0;
	--nut-form-item-label-font-size: 12px;
	--nut-input-border-bottom: #588bff 1px;
	--nut-checkbox-label-color: #606266;
	--nut-checkbox-label-font-size: 12px;
	--nut-primary-color: #165dff;
	--nut-input-font-size: 12px;
	--nut-navbar-title-font: 16px;
	--nut-icon-line-height: 20px;
	.nut-form {
		.nut-form-item {
			margin-bottom: 5px;
			border-bottom: 1px solid #e3e4e5;
		}
		.validity-upload-title {
			font-size: 14px;
			color: #000;
			span {
				font-size: 12px;
				color: #909399;
			}
		}
		.validity-uploader {
			margin-top: 20px;
		}
		.selector-box {
			color: #000;
			font-size: 12px;
			display: flex;
			justify-content: space-between;
			span {
				color: #929292;
			}
		}
		.basedata-form-title {
			font-size: 14px;
			color: #000;
		}
	}
	.create-unit-submit-button {
		height: 35px;
		font-size: 14px;
		color: #165dff;
		border: 1px solid #034196;
		border-radius: 16px;
	}
	.message {
		height: 100px;
		overflow-y: scroll;
		overflow-x: scroll;
		color: #1c2023;
	}
}
</style>
